import 'article_data_bean.dart';

class HomeArticleTopEntity {
  /*
{
  "data": [
    {
      "apkLink": "",
      "audit": 1,
      "author": "扔物线",
      "canEdit": false,
      "chapterId": 249,
      "chapterName": "干货资源",
      "collect": false,
      "courseId": 13,
      "desc": "",
      "descMd": "",
      "envelopePic": "",
      "fresh": true,
      "host": "",
      "id": 12554,
      "link": "https://url.rengwuxian.com/gw",
      "niceDate": "刚刚",
      "niceShareDate": "2020-03-23 16:36",
      "origin": "",
      "prefix": "",
      "projectLink": "",
      "publishTime": 1643558400000,
      "realSuperChapterId": 248,
      "selfVisible": 0,
      "shareDate": 1584952597000,
      "shareUser": "",
      "superChapterId": 249,
      "superChapterName": "干货资源",
      "tags": [
        null
      ],
      "title": "给高级 Android 工程师的进阶手册",
      "type": 1,
      "userId": -1,
      "visible": 1,
      "zan": 0
    }
  ],
  "errorCode": 0,
  "errorMsg": ""
} 
*/
  List<ArticleDataBean>? data;
  int? errorCode;
  String? errorMsg;

  HomeArticleTopEntity({this.data, this.errorCode, this.errorMsg});

  HomeArticleTopEntity.fromJson(Map<String, dynamic> json) {
    if (json["data"] is List)
      this.data = json["data"] == null
          ? null
          : (json["data"] as List).map((e) => ArticleDataBean.fromJson(e)).toList();
    if (json["errorCode"] is int) this.errorCode = json["errorCode"];
    if (json["errorMsg"] is String) this.errorMsg = json["errorMsg"];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null)
      data["data"] = this.data?.map((e) => e.toJson()).toList();
    data["errorCode"] = this.errorCode;
    data["errorMsg"] = this.errorMsg;
    return data;
  }
}

